Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@babel/preset-typescript
Advanced tools
The @babel/preset-typescript package is a Babel preset for TypeScript, which allows Babel to parse and transform TypeScript code into JavaScript. This enables developers to use TypeScript's static typing features while leveraging Babel's ability to compile modern JavaScript to be compatible with older browsers or environments.
TypeScript Compilation
Compiles TypeScript code to JavaScript by stripping out type annotations and handling TypeScript-specific syntax.
const x: number = 10;
Support for TypeScript Features
Supports various TypeScript features like enums, interfaces, and namespaces, converting them to equivalent JavaScript code.
enum Color { Red, Green, Blue }; let c: Color = Color.Green;
Integration with Babel Toolchain
Easily integrates with the Babel toolchain, allowing TypeScript files to be included in Babel's build process alongside other JavaScript files.
module.exports = { presets: ['@babel/preset-typescript'] };
ts-loader is a TypeScript loader for webpack. It compiles TypeScript to JavaScript before bundling. It differs from @babel/preset-typescript in that it is specifically designed for use with webpack and uses the TypeScript compiler (tsc) directly rather than Babel.
Similar to ts-loader, awesome-typescript-loader is another loader for webpack that compiles TypeScript to JavaScript. It offers features like Babel integration and type checking in a separate process. It is an alternative to ts-loader and provides similar functionality to @babel/preset-typescript but with a focus on webpack integration.
The official TypeScript npm package provides the TypeScript compiler (tsc) which can be used to compile TypeScript files directly without Babel. It is more comprehensive in terms of TypeScript feature support compared to @babel/preset-typescript, which is focused on integrating TypeScript with Babel's ecosystem.
Babel preset for TypeScript.
See our website @babel/preset-typescript for more information or the issues associated with this package.
Using npm:
npm install --save-dev @babel/preset-typescript
or using yarn:
yarn add @babel/preset-typescript --dev
v7.24.7 (2024-06-05)
babel-node
babel-traverse
constantViolations
with destructuring (@liuxingbaoyu)babel-helper-transform-fixture-test-runner
, babel-plugin-proposal-explicit-resource-management
using
in switch
correctly (@liuxingbaoyu)babel-helpers
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
FAQs
Babel preset for TypeScript.
The npm package @babel/preset-typescript receives a total of 13,421,206 weekly downloads. As such, @babel/preset-typescript popularity was classified as popular.
We found that @babel/preset-typescript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.